<template>
  <!-- 头部 -->
  <div>
    <div class="book_top">
      <ul class="book_top_menu">
        <li>
         
        </li>
        <li>
          <router-link tag="span" to="/bookshelf" class="iconfont icon-B"></router-link>
          <router-link tag="span" to="/my" class="iconfont icon-B2"></router-link>
          <router-link tag="span" to="/search" class="iconfont icon-B1"></router-link>
        </li>
      </ul>
      <div style="text-align:center;">
        <ul class="book_top_Nav">
          <router-link to="/home" tag="li">推荐</router-link>
          <router-link to="/Vip" tag="li">VIP</router-link>

          <li class="book_top_Nav_up">更新</li>
          <router-link tag="li" to="/comment">书评</router-link>

          <router-link tag="li" to="/img">分类</router-link>

        </ul>
        <!-- <ul class="book_tab">
                <li class="book_tab_UP">全部作品</li>
                <li><a href="#">签约VIP作品</a></li>
              </ul>
            -->
      </div>

    </div>
    <!-- 轮播图 -->


    <van-tabs v-model="activeName" class="newpage" sticky type="card">
      <van-tab title="全部作品" name="a">
        <div id="page" class="topage">

          <ul class="book_bk_qs1 book_list" v-for="(image, index) in newVip" :key="'ifo-' + index">
            <router-link tag="a" :to="'./BookContent?id=' + image.id">
              <li><img :src="image.imc">
                <div>战斗 / 运动 / 倒追 / 女性主角 /</div>
              </li>

              <li>

                <div id="listtitle">{{ image.name }}</div>
                <span class="iconfont icon-aixin1"
                  style="font-size: 14px;margin-right: -2px; width: 12px;color:#FBDC04;"
                  v-for="item in newVip.orangeNum" :key="item"></span>

                <div class="zuozhe">{{ image.author }}/玄幻</div>
              </li>
            </router-link>
          </ul>


        </div>
      </van-tab>
      <van-tab title="签约VIP作品" name="b">
        <div id="page" class="topage">

          <ul class="book_bk_qs1 book_list" v-for="(image, index) in  vipEnd" :key="'ifo-' + index">
            <router-link tag="a" :to="'./BookContent?id=' + image.id">
              <li><img :src="image.imc">
                <div>战斗 / 运动 / 倒追 / 女性主角 /</div>
              </li>

              <li>

                <div id="listtitle">{{ image.name }}</div>
                <span class="iconfont icon-aixin1"
                  style="font-size: 14px;margin-right: -2px; width: 12px;color:#FBDC04;"
                  v-for="item in newVip.orangeNum" :key="item"></span>

                <div class="zuozhe">{{ image.author }}/玄幻</div>
              </li>
            </router-link>
          </ul>


        </div>
      </van-tab>

    </van-tabs>


  </div>
</template>
  
  
<script>
// import "../assets/font/iconfont";
// import Swiper from "swiper";
import { getJsonData } from '@/api/home';

export default {
  data() {
    return {
      activeName: 'a',
      indexSwiper: 0,
      images1: null,
      newVip: null,
      vipEnd: null,
      bookId: null,
      orangeNum: null,
      num: null
    };
  },
  created() {
     // 获取json数据
    getJsonData().then(data => {
      console.log(data);
      this.images1 = data.vip1
      this.newVip = data.newvip
      this.vipEnd = data.vipEnd

    });

  },
  methods: {
    onChange(index) {
      this.indexSwiper = index;
    }
  }

}
</script>
  
  
<style lang="scss">
.van-tab__pane {
  margin-top: 55px;
}

.van-tabs__nav--card {
  position: fixed;
  z-index: 90;
  display: -webkit-box;
  margin: 0;
  border: 1px solid #E7E7E7;
  background: #FFF;
  -webkit-box-pack: center;
  -webkit-box-align: center;
  -webkit-box-flex: 1;
  border-radius: 17.55px;
  height: 45px;
  font-size: 12.87px;
  width: 100%;
  min-width: 320px;
    max-width: 750px;

}

.van-tabs__nav--card .van-tab.van-tab--active {
  background-color: #ff6600;
  border-radius: 17px;
}

.van-tabs__nav--card .van-tab {
  color: #ff6600;
  border-right: 2px solid transparent;

}

.newpage {
  margin-top: 85px;

}

.newtop {
  margin-top: 17.12px;

  overflow: hidden;

}

.fengtui_list {
  font-size: 0;
}

.fengtui_list li {
  display: inline-block;
  width: 30.1%;
  margin-left: 2.4%;
  text-align: center;
  vertical-align: top;
}

.fengtui_list li img {
  margin-bottom: 0.02rem;
  width: 100%;
}

body {
  background-color: #F3F3F3;
}

p {
  display: block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
}

.Linkfont li {
  color: #666;
  text-decoration: none;
  font-size: 11.718px;
}

.recommended_list li {
  display: inline-block;
  width: 22%;
  margin-left: 2.4%;
  text-align: center;
  vertical-align: top;
}

.recommended_list li img {
  margin-bottom: 2.344px;
  width: 100%;
}

.recommended_list {
  font-size: 0;
}

.book_bk_qs1 {
  border-style: solid;
  border-width: 1px 0px;
  -webkit-border-image: url("../assets/images/1px_bk_qs2.png") 2 0 stretch;
  background: #FFF;
}

.book_Content_title {
  text-align: left;
  color: #333;
  font-size: 14.062px;
  height: 35.154px;
  line-height: 35.154px;
}

.book_top {
  max-width: 750px;
  min-width: 375px;
  position: fixed;
  z-index: 90;
  width: 100%;
  top: 0;
  color: #666;
  border-top-width: 0px;
  background: #fff;
  margin: 0 auto;
}

.book_top_menu {
  margin: 5.859px 5.859px 0 5.859px;
  height: 24.608px;
  display: -webkit-box;

  li {
    display: -webkit-box;
    width: 50%;
    color: #f90;

    a {
      color: #f90;
    }

    &:last-child {
      -webkit-box-pack: end;
      -webkit-box-align: center;
    }

    span {
      font-size: 18.749px;
      padding: 0 10px;
    }
  }
}

.book_top_Nav {
  font-size: 16.405px;
  display: inline-block;

  li {
    display: inline-block;
    line-height: 46.872px;
    text-align: center;
    padding: 0 11.718px;
    border-bottom: 3px solid #fff;

    a {
      color: #666;
      display: block;
      width: 100%;
    }
  }
}

.book_top_Nav_up {
  border-bottom-color: #f90 !important;

  a {
    font-weight: bold;
    color: #f90 !important;
  }
}

.bannerbox {
  background-image: linear-gradient(#E9ECEC, #ffffff);

  height-min: 137px;

  .swiper {
    margin-top: 85px;
    background-color: aqua;

    overflow: hidden;

    .custom-indicator {
      width: 100%;
      position: absolute;
      left: 0px;
      bottom: 18px;
      text-align: center;

      ul {

        display: inline-block;
        margin: 0 auto;

        li {
          border-radius: 10px;
          display: inline-block;
          width: 7px;
          height: 7px;
          margin: 0px 5px;
          background-color: rgba(255, 255, 255, 0.6);

          &.con {
            background-color: #ff6600;
          }
        }
      }
    }
  }
}

.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
</style>